package com.mall.util;

import java.util.Date;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service
@Scope("prototype")
public class MyUtil {
	private String keys1;
	private String keys2;
	private Integer num1;
	private Integer num2;
	private Date dates;
	private double ds;
	private double ds2;
	public double getDs2() {
		return ds2;
	}

	public void setDs2(double ds2) {
		this.ds2 = ds2;
	}
	/**
	 * 判空
	 *
	 *@dagewang 2017年10月24日
	 */
	public boolean isNull(Object...obj) {
		for(int i=0;i<obj.length;i++){
			if(obj[i]==null||obj[i].equals("")){
				return true;
			}
		}
		return false; 
	}
	/**
	 *通过总数和每页需要多少条,计算有多少页
	 *@dagewang 2017年7月31日
	 */
	public  Integer getPage(Integer count, Integer pageNum) {
		double size = (double) count;
		size = size / pageNum;
		if (size < 1) {
			size = 1;
		} else {

			size = Math.ceil(size);

		}
		Integer countSize = (int) size;

		return countSize;

	}

	public String getKeys1() {
		return keys1;
	}

	public void setKeys1(String keys1) {
		this.keys1 = keys1;
	}

	public String getKeys2() {
		return keys2;
	}

	public void setKeys2(String keys2) {
		this.keys2 = keys2;
	}

	public Integer getNum1() {
		return num1;
	}

	public void setNum1(Integer num1) {
		this.num1 = num1;
	}

	public Integer getNum2() {
		return num2;
	}

	public void setNum2(Integer num2) {
		this.num2 = num2;
	}

	public Date getDates() {
		return dates;
	}

	public void setDates(Date dates) {
		this.dates = dates;
	}

	public double getDs() {
		return ds;
	}

	public void setDs(double ds) {
		this.ds = ds;
	}
	

	
}
